package JSE_03.Demo03;

import java.util.Objects;

public class Demo03Objects {
    public static void main(String[] args){
        method(null);
    }

    public static void method(Object obj){
//        if(obj==null){
//            throw new NullPointerException("传递的是null");
//        }

        Objects.requireNonNull(obj,"传递的是null");

    }
}
